fp = open(r'D:\test.txt','a+')
print('hello world', file=fp)
fp.close()